From: Claudio Cambra Date: Thu, 28 Nov 2024 09:04:50 +0000 (+0800) Subject: Ensure use of QMessageBox-using QMessageBox::critical X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~173^2~21 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=30ee3d65ee829387033cca554ff2bb9877a64958;p=nextcloud-desktop.git Ensure use of QMessageBox-using QMessageBox::critical Fixes deprecation warnings Signed-off-by: Claudio Cambra f ensure qmessagebox Signed-off-by: Claudio Cambra f2 ensure qm Signed-off-by: Claudio Cambra f3 Signed-off-by: Claudio Cambra f4 Signed-off-by: Claudio Cambra --- diff --git a/src/gui/application.cpp b/src/gui/application.cpp index dcac6ad32..0aaeffd79 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -588,7 +588,8 @@ AccountManager::AccountsRestoreResult Application::restoreLegacyAccount() tr("There was an error while accessing the configuration " "file at %1. Please make sure the file can be accessed by your system account.") .arg(ConfigFile().configFile()), - tr("Quit %1").arg(Theme::instance()->appNameGUI())); + QMessageBox::Ok + ); QTimer::singleShot(0, qApp, &QCoreApplication::quit); } } diff --git a/src/gui/editlocallymanager.cpp b/src/gui/editlocallymanager.cpp index 59c25e830..e2c3d3c7e 100644 --- a/src/gui/editlocallymanager.cpp +++ b/src/gui/editlocallymanager.cpp @@ -52,7 +52,7 @@ void EditLocallyManager::showError(const QString &message, const QString &inform void EditLocallyManager::showErrorNotification(const QString &message, const QString &informativeText) { - Systray::instance()->showMessage(message, informativeText, Systray::MessageIcon::Critical); + Systray::instance()->showMessage(message, informativeText, Systray::MessageIcon::Critical); } void EditLocallyManager::showErrorMessageBox(const QString &message, diff --git a/src/gui/foldercreationdialog.cpp b/src/gui/foldercreationdialog.cpp index a245c9f4d..302bc0412 100644 --- a/src/gui/foldercreationdialog.cpp +++ b/src/gui/foldercreationdialog.cpp @@ -77,7 +77,7 @@ void FolderCreationDialog::accept() if (QDir(_destination).mkdir(ui->newFolderNameEdit->text())) { Q_EMIT folderCreated(fullPath); } else { - QMessageBox::critical(this, tr("Error"), tr("Could not create a folder! Check your write permissions.")); + QMessageBox::critical(this, tr("Error"), tr("Could not create a folder! Check your write permissions."), QMessageBox::Ok); } QDialog::accept(); diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 562e41642..843be0dd5 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -129,7 +129,8 @@ bool createDebugArchive(const QString &filename) QMessageBox::critical( nullptr, QObject::tr("Failed to create debug archive"), - QObject::tr("Could not create debug archive in selected location!") + QObject::tr("Could not create debug archive in selected location!"), + QMessageBox::Ok ); return false; } diff --git a/src/gui/main.cpp b/src/gui/main.cpp index da946bc3b..b603a8a7c 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -45,12 +45,16 @@ using namespace OCC; void warnSystray() { - QMessageBox::critical(nullptr, qApp->translate("main.cpp", "System Tray not available"), + QMessageBox::critical( + nullptr, + qApp->translate("main.cpp", "System Tray not available"), qApp->translate("main.cpp", "%1 requires on a working system tray. " "If you are running XFCE, please follow " "these instructions. " "Otherwise, please install a system tray application such as \"trayer\" and try again.") - .arg(Theme::instance()->appNameGUI())); + .arg(Theme::instance()->appNameGUI()), + QMessageBox::Ok + ); } int main(int argc, char **argv) diff --git a/src/gui/socketapi/socketapi.cpp b/src/gui/socketapi/socketapi.cpp index cf47d3f5b..a3df567ee 100644 --- a/src/gui/socketapi/socketapi.cpp +++ b/src/gui/socketapi/socketapi.cpp @@ -546,10 +546,13 @@ void SocketApi::processEncryptRequest(const QString &localFile) Q_ASSERT(rec.isValid()); if (!account->e2e() || account->e2e()->_mnemonic.isEmpty()) { - const int ret = QMessageBox::critical(nullptr, - tr("Failed to encrypt folder at \"%1\"").arg(fileData.folderRelativePath), - tr("The account %1 does not have end-to-end encryption configured. " - "Please configure this in your account settings to enable folder encryption.").arg(account->prettyName())); + const int ret = QMessageBox::critical( + nullptr, + tr("Failed to encrypt folder at \"%1\"").arg(fileData.folderRelativePath), + tr("The account %1 does not have end-to-end encryption configured. " + "Please configure this in your account settings to enable folder encryption.").arg(account->prettyName()), + QMessageBox::Ok + ); Q_UNUSED(ret) return; } @@ -563,10 +566,13 @@ void SocketApi::processEncryptRequest(const QString &localFile) job->setParent(this); connect(job, &OCC::EncryptFolderJob::finished, this, [fileData, job](const int status) { if (status == OCC::EncryptFolderJob::Error) { - const int ret = QMessageBox::critical(nullptr, - tr("Failed to encrypt folder"), - tr("Could not encrypt the following folder: \"%1\".\n\n" - "Server replied with error: %2").arg(fileData.folderRelativePath, job->errorString())); + const int ret = QMessageBox::critical( + nullptr, + tr("Failed to encrypt folder"), + tr("Could not encrypt the following folder: \"%1\".\n\n" + "Server replied with error: %2").arg(fileData.folderRelativePath, job->errorString()), + QMessageBox::Ok + ); Q_UNUSED(ret) } else { const int ret = QMessageBox::information(nullptr,